/*
* Distributable under LGPL v3 license.
* See terms of license at https://github.com/Yunfeng/schotel/blob/master/LICENSE
*/
package cn.buk.tms.hotel.dto;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

/**
 * @author yfdai
 */
public class MasterHotelDto {

    /**
     * 本地数据库中的主酒店id
     */
    private int id;

    /**
     * 供应商的主酒店ID
     */
    private int supplierMasterHotelId;


    private String hotelName;
    private String hotelEnglishName;
    private String address;
    private String fax;
    private String tel;

    private String brandCode;
    private String brandName;
    private Integer roomCount;
    private String cityName;
    private String areaName;


    private Float starRating;
    private Boolean officialRating;

    private Integer rstar;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate openYear;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate renovationYear;

    private String shortIntro;
    private String longIntro;

    /**
     * 最低价，起价，指最便宜的一晚价格
     */
    private Double lowestPrice;

    /**
     * 基础房型信息
     */
    private List<HotelRoomTypeDto> roomTypes;

    private List<HotelPictureDto> pictures;


    public void addRatePlan(HotelRatePlanDto rp) {
        for(HotelRoomTypeDto room: roomTypes) {
            if (room.getRoomTypeName() != null && room.getRoomTypeName().equalsIgnoreCase(rp.getRoomTypeName())) {
                room.getRatePlans().add(rp);
            }
        }
    }

    public String getHotelName() {
        return hotelName;
    }

    public void setHotelName(String hotelName) {
        this.hotelName = hotelName;
    }

    public List<HotelPictureDto> getPictures() {
        if (pictures == null) {
            pictures = new ArrayList<>();
        }
        return pictures;
    }

    public void setPictures(List<HotelPictureDto> pictures) {
        this.pictures = pictures;
    }

    public List<HotelRoomTypeDto> getRoomTypes() {
        if (roomTypes == null) {
            roomTypes = new ArrayList<>();
        }
        return roomTypes;
    }

    public void setRoomTypes(List<HotelRoomTypeDto> roomTypes) {
        this.roomTypes = roomTypes;
    }

    public String getHotelEnglishName() {
        return hotelEnglishName;
    }

    public void setHotelEnglishName(String hotelEnglishName) {
        this.hotelEnglishName = hotelEnglishName;
    }

    public String getBrandCode() {
        return brandCode;
    }

    public void setBrandCode(String brandCode) {
        this.brandCode = brandCode;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public Integer getRoomCount() {
        return roomCount;
    }

    public void setRoomCount(Integer roomCount) {
        this.roomCount = roomCount;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getLongIntro() {
        return longIntro;
    }

    public void setLongIntro(String longIntro) {
        this.longIntro = longIntro;
    }

    public String getShortIntro() {
        return shortIntro;
    }

    public void setShortIntro(String shortIntro) {
        this.shortIntro = shortIntro;
    }

    public LocalDate getRenovationYear() {
        return renovationYear;
    }

    public void setRenovationYear(LocalDate renovationYear) {
        this.renovationYear = renovationYear;
    }

    public LocalDate getOpenYear() {
        return openYear;
    }

    public void setOpenYear(LocalDate openYear) {
        this.openYear = openYear;
    }

    public Integer getRstar() {
        return rstar;
    }

    public void setRstar(Integer rstar) {
        this.rstar = rstar;
    }

    public Boolean getOfficialRating() {
        return officialRating;
    }

    public void setOfficialRating(Boolean officialRating) {
        this.officialRating = officialRating;
    }

    public Float getStarRating() {
        return starRating;
    }

    public void setStarRating(Float starRating) {
        this.starRating = starRating;
    }

    public Double getLowestPrice() {
        return lowestPrice;
    }

    public void setLowestPrice(Double lowestPrice) {
        this.lowestPrice = lowestPrice;
    }

    public int getSupplierMasterHotelId() {
        return supplierMasterHotelId;
    }

    public void setSupplierMasterHotelId(int supplierMasterHotelId) {
        this.supplierMasterHotelId = supplierMasterHotelId;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
}
